home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / gzip 1.2.2 / Makefile.in < prev    next >
Encoding:
Makefile  |  1993-06-22  |  10.9 KB  |  350 lines  |  [TEXT/MPS ]

  1. # Makefile for gzip (GNU zip)    -*- Indented-Text -*-
  2. # Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # $Id: Makefile.in,v 0.22 1993/06/16 17:24:19 jloup Exp $
  19.  
  20. #### Start of system configuration section. ####
  21.  
  22.  
  23. srcdir = @srcdir@
  24. VPATH = @srcdir@
  25.  
  26. CC = @CC@
  27. CPP = @CPP@
  28.  
  29. INSTALL = @INSTALL@
  30. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  31. INSTALL_DATA = @INSTALL_DATA@
  32.  
  33. # Things you might add to DEFS (configure usually figures out what to do):
  34. # -DGNU_STANDARD        Behave as gzip even if invoked as gunzip (GNU standard)
  35. # -DDIRENT              Use <dirent.h>  for recursion (-r)
  36. # -DSYSDIR              Use <sys/dir.h> for recursion (-r)
  37. # -DSYSNDIR             Use <sys/ndir.h> for recursion (-r)
  38. # -DNDIR                Use <ndir.h> for recursion (-r)
  39. # -DSTDC_HEADERS        Use <stdlib.h>
  40. # -DHAVE_UNISTD_H    Use <unistd.h>
  41. # -DNO_FCNTL_H          Don't use <fcntl.h>
  42. # -DNO_UTIME_H        Don't use <utime.h>
  43. # -DHAVE_SYSUTIME_H    Use <sys/utime.h>
  44. # -DNO_MEMORY_H         Don't use <memory.h>. Not needed if STDC_HEADERS.
  45. # -DNO_STRING_H         Use strings.h, not string.h. Not needed if STDC_HEADERS
  46. # -DRETSIGTYPE=int      Define this if signal handlers must return an int.
  47. # -DNO_SYMLINK          OS defines S_IFLNK but does not support symbolic links
  48. # -DNO_MULTIPLE_DOTS    System does not allow file names with multiple dots
  49. # -DNO_UTIME        System does not support setting file modification time
  50. # -DNO_CHOWN        System does not support setting file owner
  51. # -DNO_DIR        System does not support readdir()
  52. # -DPROTO        Force function prototypes even if __STDC__ not defined
  53. # -DASMV        Use asm version match.S
  54. # -DMSDOS        MSDOS specific
  55. # -DOS2            OS/2 specific
  56. # -DVAXC        Vax/VMS with Vax C compiler
  57. # -DVMS            Vax/VMS with gcc
  58. # -DDEBUG        Debug code
  59. # -DDYN_ALLOC        Use dynamic allocation of large data structures
  60. # -DMAXSEG_64K        Maximum array size is 64K (for 16 bit system)
  61. # -DRECORD_IO           read() and write() are rounded to record sizes.
  62. # -DNO_STDIN_FSTAT      fstat() is not available on stdin
  63. # -DNO_FSTAT            fstat() is not available
  64. # -DNO_SIZE_CHECK       stat() does not give a reliable file size
  65.  
  66. DEFS = @DEFS@
  67. LIBS = @LIBS@
  68. ALLOCA = @ALLOCA@ 
  69.  
  70. # additional assembly sources for particular systems may be required.
  71. OBJA = @OBJA@
  72.  
  73. SEDCMD = @SEDCMD@
  74.  
  75. CFLAGS = @CFLAGS@
  76. # If you want debug on by default, use: CFLAGS="-g" ./configure
  77. LDFLAGS = $(CFLAGS)
  78.  
  79. X=
  80. # For OS/2 or MSDOS, use: X=.exe
  81.  
  82. O=.o
  83. # For OS/2 or MSDOS, use: O=.obj
  84.  
  85. ZCAT=zcat
  86. # To install zcat executable and man page as gzcat, use: ZCAT=gzcat
  87.  
  88. prefix = /usr/local
  89. exec_prefix = $(prefix)
  90.  
  91. bindir = $(exec_prefix)/bin
  92. scriptdir = $(bindir)
  93. # scriptdir is the directory in which shell scripts should be installed
  94. datadir = $(prefix)/lib
  95. libdir = $(prefix)/lib
  96. infodir = $(prefix)/info
  97.  
  98. # Extension (not including `.') for the installed manual page filenames.
  99. manext = 1
  100. # Where to install the manual pages.
  101. mandir = $(prefix)/man/man$(manext)
  102.  
  103. alldirs = $(bindir) $(scriptdir) $(datadir) $(libdir) $(infodir) $(mandir)
  104.  
  105. #### End of system configuration section. ####
  106.  
  107. SHELL = /bin/sh
  108.  
  109. LOADLIBES = $(LIBS)
  110.  
  111. TAR = tar
  112.  
  113. SRCS = gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c crypt.c\
  114.        lzw.c unlzw.c unpack.c unlzh.c getopt.c alloca.c match.S
  115.  
  116. OBJS = gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O util$O \
  117.        crypt$O lzw$O unlzw$O unpack$O unlzh$O getopt$O $(OBJA) $(ALLOCA)
  118.  
  119. HDRS = gzip.h lzw.h tailor.h revision.h crypt.h getopt.h
  120.  
  121. GENFILES =  README NEWS INSTALL Makefile.in configure.in configure COPYING \
  122.   TODO THANKS ChangeLog $(SRCS) $(HDRS) zmore.in znew.in zdiff.in zgrep.in \
  123.   zforce.in gzexe.in gzip.1 zdiff.1 zgrep.1 zmore.1 znew.1 gzexe.1 zforce.1 \
  124.   gzip.doc algorithm.doc gzip.texi texinfo.tex gpl.texinfo gzip.info
  125.  
  126. sampleFILES =  sample/makecrc.c sample/zread.c sample/add.c sample/sub.c \
  127.        sample/ztouch
  128.  
  129. msdosFILES = msdos/tailor.c msdos/match.asm msdos/gzip.prj msdos/doturboc.bat \
  130.   msdos/Makefile.msc msdos/Makefile.bor msdos/Makefile.djg
  131.  
  132. os2FILES = os2/Makefile.os2 os2/gzip.def os2/gzip16.def
  133.  
  134. vmsFILES = vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com \
  135.    vms/Makefile.mms vms/vms.c vms/gzip.hlp
  136.  
  137. amigaFILES = amiga/Makefile.sasc amiga/Makefile.gcc amiga/tailor.c \
  138.   amiga/utime.h amiga/match.a
  139.  
  140. atariFILES = atari/Makefile.st
  141.  
  142. primosFILES = primos/readme primos/primos.c primos/alloca.pma primos/ci.opts \
  143.    primos/build.cpl primos/include/errno.h primos/include/fcntl.h \
  144.    primos/include/stdlib.h primos/include/sysStat.h primos/include/sysTypes.h
  145.  
  146. DISTFILES = $(GENFILES) $(sampleFILES) $(msdosFILES) $(os2FILES) $(vmsFILES)\
  147.    $(amigaFILES) $(atariFILES) $(primosFILES)
  148.  
  149. .c$O:
  150.     $(CC) -c $(DEFS) $(CFLAGS) $<
  151.  
  152. #.PHONY: default all force test check
  153.  
  154. default:  gzip$X
  155. all:    gzip$X zdiff zgrep zmore znew zforce gzexe
  156. force:
  157.  
  158. #### Start of specific targets section. ####
  159. #
  160. # 'configure' works only on Unix systems. For other systems able to make
  161. # sense of this makefile, you can define target specific entries here.
  162. # For other systems such as MSDOS, separate Makefiles are
  163. # provided in subdirectories.
  164.  
  165. # gcc with emx 0.8f kit (use by preference os2/Makefile.os2)
  166. os2_gcc:
  167.     $(MAKE) all CC=gcc CFLAGS="-O -DOS2" X=".exe"
  168.  
  169. # Xenix 2.3.2 for 286:
  170. xenix_286:
  171.     $(MAKE) all CFLAGS="-LARGE -M2l"
  172.  
  173. # Coherent (with broken /bin/sh):
  174. coherent:
  175.     $(MAKE) all OBJA=match.o DEFS=\
  176.     "-DASMV -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1"
  177.  
  178. #### End of specific targets section. ####
  179.  
  180. install: all gzip.info installdirs
  181.     $(INSTALL_PROGRAM) gzip$X $(bindir)/gzip$X
  182.     for f in zdiff zgrep zmore znew zforce gzexe; do \
  183.       $(INSTALL_PROGRAM) $${f} $(scriptdir)/$${f}; done
  184.     rm -f $(scriptdir)/zcmp; ln $(scriptdir)/zdiff $(scriptdir)/zcmp
  185.     for f in gunzip$X ungzip$X $(ZCAT)$X ; do \
  186.       rm -f $(bindir)/$${f}; done
  187.     @if echo $(DEFS) | grep GNU_STANDARD > /dev/null; then \
  188.       echo 'exec gzip -d  $${1+"$$@"}' > $(bindir)/gunzip$X; \
  189.       echo 'exec gzip -dc $${1+"$$@"}' > $(bindir)/$(ZCAT)$X; \
  190.       chmod 755 $(bindir)/gunzip$X  $(bindir)/$(ZCAT)$X; \
  191.     else \
  192.       ln $(bindir)/gzip$X $(bindir)/gunzip$X; \
  193.       ln $(bindir)/gzip$X $(bindir)/$(ZCAT)$X; \
  194.     fi
  195.     for f in gzip gunzip $(ZCAT) zcmp zdiff zgrep zmore znew zforce gzexe; do \
  196.       rm -f $(mandir)/$${f}.$(manext); done
  197.     -cd $(srcdir); \
  198.       for f in gzip zdiff zgrep zmore znew zforce gzexe; do \
  199.       $(INSTALL_DATA) $${f}.1 $(mandir)/$${f}.$(manext); done
  200.     echo .so man$(manext)/gzip.$(manext) > $(mandir)/$(ZCAT).$(manext)
  201.     echo .so man$(manext)/gzip.$(manext) > $(mandir)/gunzip.$(manext)
  202.     echo .so man$(manext)/zdiff.$(manext) > $(mandir)/zcmp.$(manext)
  203.     -cd $(srcdir); for f in gzip.info* ; do $(INSTALL_DATA) $${f} \
  204.       $(infodir)/$${f}; done
  205.  
  206. uninstall: force
  207.     -cd $(bindir); rm -f gzip$X gunzip$X $(ZCAT)$X
  208.     -cd $(scriptdir); rm -f zcmp zdiff zgrep zmore znew zforce gzexe
  209.     -for f in gzip gunzip $(ZCAT) zcmp zdiff zgrep zmore znew gzexe; do \
  210.       rm -f $(mandir)/$${f}.$(manext); done
  211.     -cd $(infodir); rm -f gzip.info*
  212.  
  213. # install all files and replace compress (not recommended)
  214. install_compress: install
  215.     -test -f $(bindir)/compress.old || \
  216.       mv $(bindir)/compress$X $(bindir)/compress.old
  217.     ln $(bindir)/gzip$X $(bindir)/compress$X
  218.     rm -f $(bindir)/uncompress$X
  219.     ln $(bindir)/gzip$X $(bindir)/uncompress$X
  220.  
  221. # Make sure all installation directories, e.g. $(bindir) actually exist by
  222. # making them if necessary. At most one level is created (except for man).
  223. installdirs:
  224.     -if test ! -d $(prefix)/man; then \
  225.        mkdir $(prefix)/man; fi
  226.     -for dir in $(alldirs) ; do \
  227.        if test ! -d $${dir}; then \
  228.          mkdir $${dir}; fi; \
  229.     done
  230.  
  231. test: check
  232. check:    gzip$X
  233.     ./gzip -6 < $(srcdir)/texinfo.tex > _gztest.gz
  234.     @LANG=""; export LANG; if test `wc -c < _gztest.gz` -eq 30890; then \
  235.        true; \
  236.     else \
  237.        echo FAILED gzip test: incorrect size; \
  238.     fi
  239.     rm -f _gztest
  240.     ./gzip -d _gztest.gz
  241.     @if cmp _gztest $(srcdir)/texinfo.tex; then \
  242.        echo gzip test OK; \
  243.     else \
  244.        echo FAILED gzip test: incorrect decompress; \
  245.     fi
  246.     rm -f _gztest*
  247.  
  248. TAGS: $(SRCS) $(HDRS)
  249.     cd $(srcdir); etags $(SRCS) $(HDRS)
  250.  
  251. Makefile: Makefile.in ./config.status
  252.     ./config.status
  253.  
  254. ./config.status: configure
  255.     $(srcdir)/configure --srcdir=$(srcdir) --no-create
  256.  
  257. configure: configure.in
  258.     @echo Warning: configure is out of date
  259. #    cd $(srcdir); autoconf
  260.  
  261. clean:
  262.     rm -f *$O gzip$X gunzip$X ungzip$X $(ZCAT)$X add$X sub$X a.out core
  263.     rm -f zcmp zdiff zgrep zmore znew zforce gzexe _gztest*
  264.     rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
  265.     rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
  266.  
  267. mostlyclean: clean
  268.  
  269. distclean: clean
  270.     rm -f Makefile config.status
  271.  
  272. realclean: distclean
  273.     rm -f TAGS gzip.info* gzip.doc
  274.  
  275. dist: $(DISTFILES) Makefile
  276.     d=gzip-`sed -e '/VERSION/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
  277.                 -e q revision.h` ; \
  278.     rm -f ../$$d; \
  279.     ln -s `pwd` ../$$d; \
  280.     cd ..; \
  281.     files=""; \
  282.     for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
  283.     GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
  284.     rm -f $$d
  285.  
  286. zipdist: $(DISTFILES) Makefile
  287.     zip -u9T gzip`sed -e '/VERSION/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
  288.               -e s/[.]//g -e q revision.h` $(DISTFILES)
  289.  
  290. # Actual build-related targets
  291.  
  292. gzip$X:    Makefile $(OBJS)
  293.     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  294.     rm -f gunzip$X $(ZCAT)$X
  295.     ln gzip$X gunzip$X
  296.     ln gzip$X $(ZCAT)$X
  297.  
  298. gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
  299. util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
  300.  
  301. gzip$O unlzw$O: revision.h lzw.h
  302.  
  303. bits$O unzip$O util$O zip$O: crypt.h
  304.  
  305. gzip$O getopt$O: getopt.h
  306.  
  307. match$O: match.S
  308.     $(CPP) $(srcdir)/match.S > _match.s
  309.     $(CC) -c _match.s
  310.     mv _match$O match$O
  311.     rm -f _match.s
  312.  
  313. zdiff: zdiff.in
  314.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zdiff.in > zdiff
  315.     chmod 755 zdiff
  316.  
  317. zgrep: zgrep.in
  318.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zgrep.in > zgrep
  319.     chmod 755 zgrep
  320.  
  321. zmore: zmore.in
  322.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zmore.in > zmore
  323.     chmod 755 zmore
  324.  
  325. znew: znew.in
  326.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/znew.in > znew
  327.     chmod 755 znew
  328.  
  329. zforce: zforce.in
  330.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zforce.in >zforce
  331.     chmod 755 zforce
  332.  
  333. gzexe: gzexe.in
  334.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/gzexe.in > gzexe
  335.     chmod 755 gzexe
  336.  
  337. gzip.info: gzip.texi
  338.     cd $(srcdir); makeinfo gzip.texi
  339.  
  340. gzip.dvi: gzip.texi
  341.     cd $(srcdir); texi2dvi gzip.texi
  342.  
  343. gzip.doc: gzip.1
  344.     nroff -man $(srcdir)/gzip.1 | col -b | uniq > gzip.doc
  345.  
  346. # Prevent GNU make v3 from overflowing arg limit on SysV.
  347. .NOEXPORT:
  348.  
  349. # end of file
  350.